package org.iabako.shared.iservice.business;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import org.iabako.shared.dto.FinancesBalance;
import org.iabako.shared.dto.FinancesChartData;
import org.iabako.shared.entity.user.Enterprise;

import java.util.List;

/**
 * Created by jose on 12/11/14.
 */
public interface FinanceServiceAsync {

    void getFinancesBalanceByDay(String yyyyMMDD, AsyncCallback<FinancesBalance> async);

    void getFinancesBalanceByMonth(int month, AsyncCallback<FinancesBalance> async);

    void getFinancesBalanceByYear(int year, AsyncCallback<FinancesBalance> async);

    void getPendingResume(AsyncCallback<List<Double>> async);

    void getSalesExpensesForLastMonths(String ddMMyyyy, AsyncCallback<List<FinancesChartData>> async);

    void getSalesExpensesForLastYears(int year, AsyncCallback<List<FinancesChartData>> asyncCallback);

    void getExpensesByCategoryForMonth(int month, AsyncCallback<List<FinancesChartData>> iabakoAsyncCallback);

    void getExpensesByCategoryForYear(int year, AsyncCallback<List<FinancesChartData>> iabakoAsyncCallback);

    void getBestClients(AsyncCallback<List<FinancesChartData>> iabakoAsyncCallback);

    void getBestServices(AsyncCallback<List<FinancesChartData>> iabakoAsyncCallback);

    void getWorstClients(AsyncCallback<List<FinancesChartData>> iabakoAsyncCallback);

    void getBestProducts(AsyncCallback<List<FinancesChartData>> iabakoAsyncCallback);

    void getPendingResume(Enterprise enterprise, AsyncCallback<List<Double>> async);

    public static final class Util {
        private static FinanceServiceAsync instance;

        public static final FinanceServiceAsync getInstance() {
            if (instance == null) {
                instance = GWT.create(FinanceService.class);
            }
            return instance;
        }
    }
}
